from django.conf.urls.defaults import *
from django.conf import settings
import django.views

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^taskize/', include('taskize.foo.urls')),

    # OpenID
    (r'^account/', include('taskize.django_authopenid.urls')),

    # Primary views
    (r'^'+settings.WEB_ROOT[1:]+r'$', 'taskize.django_gtd.views.Home'),
    (r'^'+settings.WEB_ROOT[1:]+r'splash/$', 'taskize.django_gtd.views.Splash'),

    # Administrative Interface
    #  - admin documentation:
    (r'^'+settings.WEB_ROOT[1:]+r'admin/doc/', include('django.contrib.admindocs.urls')),
    #  - enable the admin:
    (r'^'+settings.WEB_ROOT[1:]+r'admin/(.*)', admin.site.root),
)


if settings.SERVE_STATIC_PAGES:
    urlpatterns += patterns('',
        (r'^'+settings.WEB_ROOT[1:]+r'media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
    )

urlpatterns += patterns('',
    # Catch all
    (r'', 'django.views.generic.simple.redirect_to', {'url':settings.WEB_ROOT}),
)




